let state = {
    countA:0
  }
let mutations = {
    incA(state){
        console.log(state)
    }
  }
let actions = {
    asyncIncA(context){
        context.commit('incA')
        console.log(context)
    },
    asyncDecA({commit}){
        commit('inc')
    },
    rootA({commit}){
        commit('rootM',null,{root:true})//调用全局mutations
    },
    acA: {//注册为全局actions
        root:true,
        handler(namespacedContext, payload){
            console.log(namespacedContext)
            console.log(payload)
            console.log('muA')
        }
    }
  }
let getters = {
    countGA(state){
      return state.countA +=100
    }
  }

export const moduleA = {
    namespaced:true,
    state,
    mutations,
    actions,
    getters
}